/*
 * Written by Rossi Kamal
 * Date 2011.01.07
 * 
 */

package net.m2m.policyrepository.neworkconfig;

import java.sql.*;
public class insertNetworkConfiguration {
 public static void main(String[] args) {
 System.out.println("Inserting values in Mysql database table!");
  Connection con = null;
  String url = "jdbc:mysql://localhost:3306/";
  String db = "mydb";
  String driver = "com.mysql.jdbc.Driver";
  try{
  Class.forName(driver);
  con = DriverManager.getConnection(url+db,"root","networking2987");
  try{
  Statement st = con.createStatement();
  int val = st.executeUpdate("INSERT M2MNetworkConfiguration VALUES("+1+","+"'192.168.10.1'"+","+"'Strict Configuration'"+","+"'Configuration is performed'"+")");
  System.out.println("1 row affected");
  }
  catch (SQLException s){
  System.out.println("SQL statement is not executed!");
  }
  }
  catch (Exception e){
  e.printStackTrace();
  }
  }
}
